#pragma once
// anyway I use gcc13.2
// #pragma clang diagnostic ignored "-Wformat-security"

// 3rd lib
#include <ncurses.h>

#include <memory>
#include <string>
#include <vector>
#include <filesystem>
#include <fstream>

// HACK: MiniVim -> Mvi
struct Mvi final {
  // default: public
  size_t x, y;
  char mode;
  std::string filename, status, section;
  std::vector<std::string> lines;

  void remove(int);
  std::string tabs(std::string& rhs);
  void insert(std::string str, int index);
  void append(std::string& rhs);

  Mvi(const std::string& rhs);
  ~Mvi();
  void run();// app exec

  void update();
  void statusline();
  void input(int index);
  void print();

  void up();
  void left();
  void right();
  void down();

  void open();
  void save();// for simple save file without any hit
};
